package com.his.modules.business;

import java.util.Arrays;

public class Test1 {
    public static void main(String[] args) {
        char[] arr = {'A', 'B', 'C'};
        permute(arr, 0, arr.length - 1);
    }
    private static void permute(char[] arr, int l, int r) {
        if (l == r) {
            System.out.println(Arrays.toString(arr));
        } else {
            for (int i = l; i <= r; i++) {
                char temp = arr[l];
                arr[l] = arr[i];
                arr[i] = temp;

                permute(arr, l + 1, r);

                temp = arr[l];
                arr[l] = arr[i];
                arr[i] = temp;
            }
        }
    }
}
